import Promise from './Promise';
const promise1 = new Promise((resolve, reject) => {
    setTimeout(() => reject('fail1'), 1000);
});
const promise2 = new Promise((resolve, reject) => {
    setTimeout(() => reject('fail2'), 2000);
});
const promise3 = new Promise((resolve, reject) => {
    setTimeout(() => resolve('success'), 3000);
});
Promise.allSettled([promise1, promise2, promise3])
    .then(value => console.log('value', value), reason => console.log('reason', reason));
/*
Promise.race([promise1,promise2,promise3])
.then(value=>console.log('value',value),reason=>console.log('reason',reason)); 

Promise.any([promise1,promise2,promise3])
.then(value=>console.log('value',value),reason=>console.log('reason',reason));

reason [AggregateError: All promises were rejected] {
  [errors]: [ 'fail1', 'fail2', 'fail3' ]
}
 */